reqObj = null;
function checkAvailable() {
	//document.getElementById("res").innerHTML = "Checking";
	if (window.XMLHttpRequest) {
		reqObj = new XMLHttpRequest();
	} else {
		reqObj = new ActiveXObject("Microsoft.XMLHTTP");
	}

	reqObj.onreadystatechange = process;
	reqObj.open("POST", "ajaxRegistrationController?typed="
			+ document.getElementById("username").value, true);
	reqObj.send(null);
}

function process() {
	if (reqObj.readyState == 4) {
		document.getElementById("res").innerHTML = reqObj.responseText;
	}
}